package com.ry;

import com.ry.util.timepick.R;
import com.ry.util.CommonConstants;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RelativeLayout;

public class PickUpActivity extends Activity {
	private Button btnBack;
	private RelativeLayout rlytAirportPickUp;
	private RelativeLayout rlytAirportDropOff;
	private RelativeLayout rlytTrainPickUp;
	private RelativeLayout rlytTrainDropOff;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.pick_up);
		init();
	}

	private void init() {
		btnBack = (Button) findViewById(R.pick_up.btn_back);
		rlytAirportPickUp = (RelativeLayout) findViewById(R.pick_up.rlyt_airport_pick_up);
		rlytAirportDropOff = (RelativeLayout) findViewById(R.pick_up.rlyt_airport_drop_off);
		rlytTrainPickUp = (RelativeLayout) findViewById(R.pick_up.rlyt_train_pick_up);
		rlytTrainDropOff = (RelativeLayout) findViewById(R.pick_up.rlyt_train_drop_off);

		btnBack.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				PickUpActivity.this.finish();
			}
		});

		rlytAirportPickUp.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(PickUpActivity.this, CityAndModelActivity.class);
				intent.putExtra("type", CommonConstants.AIRPORT_PICK_UP);
				startActivity(intent);
			}
		});

		rlytAirportDropOff.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(PickUpActivity.this, CityAndModelActivity.class);
				intent.putExtra("type", CommonConstants.AIRPORT_DROP_OFF);
				startActivity(intent);
			}
		});

		rlytTrainPickUp.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(PickUpActivity.this, CityAndModelActivity.class);
				intent.putExtra("type", CommonConstants.TRAIN_PICK_UP);
				startActivity(intent);
			}
		});

		rlytTrainDropOff.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(PickUpActivity.this, CityAndModelActivity.class);
				intent.putExtra("type", CommonConstants.TRAIN_DROP_OFF);
				startActivity(intent);
			}
		});
	}

}
